import request from './index';

export const createOrder = (orderData: any) =>
  request.post('http://localhost:9027/api-service-user/api/app/order/createOrder', orderData);

export const getOrderDetail = (page: number, pageSize: number) => {
  return request.post(`http://localhost:9027/api-service-user/api/app/order/orderDetail/${page}/${pageSize}`);
};

export const payOrder = (params: {
  orderId: number;
  amount: number;
  productId: number;
  quantity: number;
  userId: number;
}) => {
  return request.post('http://localhost:9027/api-service-pay/api/app/pay/payOrder', params);
};

export const cancelOrder = (orderId: number) => {
  return request.post(`http://localhost:9027/api-service-user/api/app/order/cancelOrder/${orderId}`);
}; 